import request from '@/utils/request'

const auth = {
  /**
   *  登录接口
   * @param params
   */
  loginAPI: function (params) {
    return request({
      url: '/auth/login',
      method: 'post',
      data: params
    })
  },
  changeLoginAPI: function (params) {
    return request({
      url: '/auth/changeLogin?username=' + params.account + '&position=' + params.positionCode,
      method: 'post',
      data: params
    })
  },
  /**
   * 退出登录
   */
  logoutAPI: function () {
    return request({
      url: '/auth/logout',
      method: 'post'
    })
  },
  /**
   *  获取登录信息
   */
  getLoginInfoAPI: function () {
    return request({
      url: '/auth/get',
      method: 'get',
      data: {}
    })
  },
  updateUserInfoAPI: function (params) {
    return request({
      url: '/auth/update/userInfo',
      method: 'put',
      data: params
    })
  },
  resetAccountPwdAPI: function (param) {
    return request({
      url: '/auth/account/restPwd/' + param.employeeCode,
      method: 'put'
    })
  },
  updateLoginPasswordAPI: function (params) {
    return request({
      url: '/auth/update/password',
      method: 'put',
      data: params
    })
  }
}
export default auth
